!function(e){!function(e){"use strict";var t,r,i,n,s,o,a,c,u,l,d,g,p,v,h,w,m,f,y,S=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},b=(e,t,r)=>(S(e,t,"read from private field"),r?r.call(e):t.get(e)),I=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},E=(e,t,r,i)=>(S(e,t,"write to private field"),i?i.call(e,r):t.set(e,r),r),C=(e,t,r)=>(S(e,t,"access private method"),r);if(false){if("undefined"!=typeof navigator&&"ReactNative"===navigator.product&&"undefined"==typeof crypto)throw new Error("React Native does not have a built-in secure random generator. If you don’t need unpredictable IDs use `nanoid/non-secure`. For secure IDs, import `react-native-get-random-values` before Nano ID.");if("undefined"!=typeof msCrypto&&"undefined"==typeof crypto)throw new Error("Import file with `if (!window.crypto) window.crypto = window.msCrypto` before importing Nano ID to fix IE 11 support");if("undefined"==typeof crypto)throw new Error("Your browser does not have secure random generator. If you don’t need unpredictable IDs, you can use nanoid/non-secure.")}let D=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let i=63&r[e];if(36>i)t+=i.toString(36);else if(62>i)t+=(i-26).toString(36).toUpperCase();else if(63>i)t+="_";else t+="-"}return t};const P="_grDebugMode",T=new class{isDebugEnabled(){return!!window.sessionStorage.getItem(P)}startDebug(){window.sessionStorage.setItem(P,"true")}},V=new class{get isLoggingEnabled(){return T.isDebugEnabled()}log(...e){this.displayLog("log",...e)}info(...e){this.displayLog("info",...e)}error(...e){if(e[0]instanceof Error)e.push(e[0].stack);this.displayLog("error",...e)}warn(...e){this.displayLog("warn",...e)}displayLog(e,...t){if(this.isLoggingEnabled)console[e](...t)}};function k(e){const t=document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));if(t)return t[2]}function _(e,t,r=""){const i=new Date;i.setTime(i.getTime()+365*24*60*60*1e3),document.cookie=`${e}=${t}; expires=${i.toUTCString()}; path=/; ${r?`domain=${r}`:""}`}function U(e){const t=new RegExp(`[?&]${e}=([^&#]*)`).exec(window.location.href);return t?decodeURI(t[1]):null}function x(e){return!!e&&"object"==typeof e}function A(e,t){const r={...e};for(const i of Object.keys(t))if(e.hasOwnProperty(i)&&x(e[i])&&x(t[i])&&!Array.isArray(e[i]))r[i]=A(e[i],t[i]);else r[i]=t[i];return r}var L=(e=>(e["SetDomain"]="setDomain",e["SetListToken"]="setListToken",e["SetUserId"]="setUserId",e["SetEvent"]="setEvent",e["SetCookie"]="setCookie",e["SetAutoFunnelData"]="setAutoFunnelData",e["Push"]="push",e["SetCustomServiceWorkerPath"]="setCustomSwPath",e["ViewItem"]="viewItem",e["ViewCategory"]="viewCategory",e["LikeItem"]="likeItem",e["UnlikeItem"]="unlikeItem",e["WishListItem"]="wishlistItem",e["Purchase"]="orderPlaced",e["CartUpdate"]="cartUpdate",e["ShopifyAbandonedCart"]="shopifyAbandonedCart",e["SaveEvent"]="saveEvent",e["FlushEvents"]="flushEvents",e["SetUserDevice"]="setUserDevice",e["SetUserLocation"]="setUserLocation",e["SetVisitUrlPath"]="setVisitUrlPath",e["SetLastActivityDate"]="setLastActivityDate",e["SetIsNewVisitor"]="setIsNewVisitor",e["SetHasUserVisitPage"]="setHasUserVisitPage",e["SetRawEvent"]="setRawEvent",e["ImportScript"]="importScript",e["DelayScript"]="delayScript",e["InitScript"]="initScript",e))(L||{}),O=(e=>(e["UserEventSaved"]="userEventSaved",e["WebPushConsentAccepted"]="webPushConsentAccepted",e["WebPushCustomConsentRejected"]="webPushCustomConsentRejected",e["WebPushNativeConsentRejected"]="webPushNativeConsentRejected",e))(O||{});const N=10;class F{constructor(){this._cvar=[]}setTrackerUrl(e){this.trackerUrl=e}markAsEnabled(e){this.isEnabled=e}setUserId(e){this.uid=e}setCustomVariable(e,t,r){if(!this._cvar[e])this._cvar[e]=[];this._cvar[e].push(t),this._cvar[e].push(r)}setGenerationTime(){var e;if(this.gt_ms)return;const t=null==(e=performance.getEntriesByType("navigation")[0])?void 0:e.toJSON();if(t)this.gt_ms=Math.floor(t.responseEnd-t.requestStart)}trackEvent(e,t,r,i){this.trackPageView(Object.assign({e_c:e,e_a:t,e_n:r,...i&&{e_v:i}}))}getCustomVariable(){return JSON.stringify(Object.assign({},this._cvar))}static getScreenResolution(){return`${screen.width??N}x${screen.height??N}`}static encodeUrlParam(e){return`${encodeURIComponent(e[0])}=${encodeURIComponent(e[1])}`}getFullTrackerUrl(e){const t=new Date;return Object.entries({...e,...document.referrer&&{urlRef:document.referrer},url:window.location.href,uid:this.uid,_cvar:this.getCustomVariable(),h:t.getHours(),m:t.getMinutes(),s:t.getSeconds(),res:F.getScreenResolution(),gt_ms:this.gt_ms}).reduce(((e,t)=>void 0===t[1]?e:`${e}&${F.encodeUrlParam(t)}`),this.trackerUrl)}trackPageView(e){if(e||this.isEnabled)if(this.setGenerationTime(),window.fetch)fetch(this.getFullTrackerUrl(e),{method:"GET",mode:"no-cors"}).catch((e=>{V.error("Error while sending tracking data:",e)}));else new Image(1,1).src=this.getFullTrackerUrl(e)}}var B=(e=>(e["UuidHasBeenSet"]="grUuidHasBeenSet",e["PopupsRendererCustomUrl"]="grPopupsRendererCustomUrl",e))(B||{});class R{constructor(){I(this,t,new Proxy({},{get(e,t){if(t in e)return e[t];else return e[t]=[],e[t]}}))}addEvent(e,r){b(this,t)[e].push(r)}drainEvents(e){const r=b(this,t)[e];return b(this,t)[e]=[],r}getEvents(e){return b(this,t)[e]}hasDelayedEvents(e){return b(this,t)[e].length>0}}t=new WeakMap,r=new WeakMap,i=new WeakMap;const W=new class{constructor(){I(this,r,{}),I(this,i,new R)}publish(e,...t){var n;if(null==(n=b(this,r)[e])?void 0:n.length)b(this,r)[e].forEach((r=>{r(...t),V.log(`Event ${e} published with arguments'`,...t)}));else b(this,i).addEvent(e,t)}subscribe(e,t,n={}){const{preventEventDraining:s,ignoreQueuedEvents:o}=n;if(!b(this,r)[e])b(this,r)[e]=[];if(b(this,i).hasDelayedEvents(e)&&!o)if(s)b(this,i).getEvents(e).forEach((e=>t(...e)));else b(this,i).drainEvents(e).forEach((e=>t(...e)));b(this,r)[e].push(t)}unsubscribe(e,t){var i;const n=null==(i=b(this,r)[e])?void 0:i.indexOf(t);if(n>-1)b(this,r)[e].splice(n,1)}removeListeners(e){delete b(this,r)[e]}};var $,j,M=(e=>(e["DeviceType"]="debug_device_type",e["Location"]="debug_location",e["VisitUrlPath"]="debug_visit_url_path",e["BrowserStorageLastActivityDate"]="debug_browser_storage_last_activity_date",e["NewVisitor"]="debug_new_visitor",e["HasUserVisitPage"]="debug_has_user_visit_page",e["Events"]="debug_events",e))(M||{});function z(){const e=e=>{const t=sessionStorage.getItem(e);if(t){if([M.DeviceType,M.VisitUrlPath,M.Location].includes(e))return t;if(e===M.BrowserStorageLastActivityDate){const e=new Date(t);return isNaN(e.getTime())?void 0:e}if([M.NewVisitor,M.HasUserVisitPage,M.Events].includes(e))try{return JSON.parse(t)}catch(r){V.error(`Invalid debug data for: ${e}`)}}};return{enabled:true,data:{[M.DeviceType]:e(M.DeviceType),[M.BrowserStorageLastActivityDate]:e(M.BrowserStorageLastActivityDate),[M.Location]:e(M.Location),[M.NewVisitor]:e(M.NewVisitor),[M.VisitUrlPath]:e(M.VisitUrlPath),[M.HasUserVisitPage]:e(M.HasUserVisitPage),[M.Events]:e(M.Events)}}}function J(e,t,r){const i=ge.debugObject;ge.debugObject={...i,data:{...null==i?void 0:i.data,[e]:t}},sessionStorage.setItem(e,r||String(t))}function G(e){var t,r;return null==(r=null==(t=ge.debugObject)?void 0:t.data)?void 0:r[e]}function q(e,t){return ge.isDebug?t:e}(j=$||($={}))["PageVisit"]="visit",j["Popup"]="popup",j["ViewItem"]="view_item",j["ViewCategory"]="view_category",j["WishlistItem"]="wishlist_item",j["LikeItem"]="like_item",j["UnlikeItem"]="unlike_item",j["OrderPlaced"]="order_placed",j["Cart"]="cart_update",void(j["ShopifyAbandonedCart"]="shopify_webhook_abandoned_cart");let H=class extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}};class X extends H{constructor(e){super(e)}}const K={cartToken:"string",urlToken:"string",visitorEmail:"string"},Y=["cartToken","urlToken"];var Z,Q,ee,te,re,ie,ne,se,oe;(oe=Z||(Z={}))["Inline"]="inline",void(oe["Popup"]="popup"),(se=Q||(Q={}))["Hq"]="Hq",void(se["Us"]="Us"),void((ee||(ee={}))["UserAid"]="X-Aid"),(ne=te||(te={}))["Active"]="active",void(ne["Inactive"]="inactive"),(ie=re||(re={}))["ReactSendWebPush"]="react_web_webpush",ie["ReactCollectWebPushConsent"]="react_web_collect_webpush_subscription",ie["ReactShowPopup"]="react_web_popup",ie["FilterWebUrl"]="filter_web_url",ie["FilterWebSubscribers"]="filter_web_subscriber",ie["FilterLocation"]="filter_web_geolocation",ie["FilterDevice"]="filter_web_device",ie["FilterReturningVisitor"]="filter_web_returning_visitor",ie["ConditionProductViewed"]="await_web_view_item_event",ie["ConditionCategoryViewed"]="await_web_view_category_event",ie["ConditionWebPushConsent"]="await_web_webpush_subscribe",ie["ConditionProductLiked"]="await_web_like_item_event",ie["TransferToBackend"]="react_backend_transfer",ie["AwaitScroll"]="await_scroll",void(ie["ShowPopup"]="react_popup"),n=new WeakMap;const ae=new class{constructor(){I(this,n,{[$.LikeItem]:[],[$.OrderPlaced]:[],[$.UnlikeItem]:[],[$.ViewCategory]:[],[$.ViewItem]:[],[$.WishlistItem]:[],[$.PageVisit]:[],[$.Popup]:[],[$.Cart]:[]})}getEvents(e){return Promise.resolve(b(this,n)[e])}getAllEvents(){return Promise.resolve(Object.values(b(this,n)).flat(1))}getAllECommerceEvents(){return Promise.resolve([...b(this,n)[$.ViewItem],...b(this,n)[$.ViewCategory],...b(this,n)[$.LikeItem],...b(this,n)[$.UnlikeItem],...b(this,n)[$.WishlistItem],...b(this,n)[$.OrderPlaced],...b(this,n)[$.Cart]])}getAllPopupEvents(){return Promise.resolve([...b(this,n)[$.Popup]])}saveEvent(e){return b(this,n)[e.eventType].push(e),Promise.resolve()}};var ce=(e=>(e["v2"]="v2",e["af"]="af",e["wp"]="wp",e["we"]="we",e["ec"]="ec",e))(ce||{}),ue=(e=>(e["v2"]="GRV2",e["af"]="GRAF",e["wp"]="GRWP",e["we"]="GRWE",e["ec"]="GREC",e))(ue||{});const le={[ce.af]:"autoFunnel",[ce.ec]:"ecommerce",[ce.v2]:"tracking",[ce.we]:"webEvents",[ce.wp]:"webPush"};s=new WeakSet,o=e=>le[e];const de=new class{constructor(){I(this,s)}setScriptInitialized(e){const t=C(this,s,o).call(this,e);window.__grIntegrationConfig[t].isModuleInitialized=true}isScriptInitialized(e){var t,r;const i=C(this,s,o).call(this,e);return(null==(r=null==(t=null==window?void 0:window.__grIntegrationConfig)?void 0:t[i])?void 0:r.isModuleInitialized)??false}},ge=new class{constructor(){this.scriptModuleManager=de}initialize(e){const{xsid:t,grid:r,clientLatestGrid:i,domain:n,aid:s,useNOStorage:o,useBetterSubscriberIdentification:a,isServedFromCustomDomain:c,scriptsDomain:u,scriptsVersion:l,tracking:d,isDebugMode:g,uuuid:p}=e;if(g)T.startDebug();window.__grIntegrationConfig=window.__grIntegrationConfig||{cData:{aid:s,grid:r,domain:n,useNOStorage:o,useBetterSubscriberIdentification:a,isServedFromCustomDomain:c,clientLatestGrid:i,uuuid:p},visitor:{email:null,eComId:null,xsid:t},tracking:{isModuleInitialized:false,isEnabled:d},webEvents:{isModuleInitialized:false,visitorApplicationEndpoint:null,automationJourneyGraphs:{},webPushActivePromptGraph:null,popupGraphs:{}},webPush:{isModuleInitialized:false,customSwPath:null,wpid:null,pushDomain:null,promptEndpoint:null},analyticsData:{scriptsDomain:u,scriptsVersion:l},ecommerce:{isModuleInitialized:false},autoFunnel:{isModuleInitialized:false},eventBus:W,temporaryEventsStorage:ae,debug:g?z():void 0,delayedScripts:{},scriptTypesInitialized:new Set}}canUseBackendForSubscriberIdentification(){return window.__grIntegrationConfig.cData.useBetterSubscriberIdentification}getUserAid(){return window.__grIntegrationConfig.cData.aid}getClientLatestGrid(){return window.__grIntegrationConfig.cData.clientLatestGrid}getUserAnalyticsDomain(){return window.__grIntegrationConfig.cData.domain}getUserUuid(){return window.__grIntegrationConfig.cData.uuuid}enablePopupDevMode(){window.__grIntegrationConfig.setCustomPopupRendererUrl=e=>{window.sessionStorage.setItem(B.PopupsRendererCustomUrl,e)}}getPopupRendererCustomUrl(){return window.sessionStorage.getItem(B.PopupsRendererCustomUrl)}setCustomSwPath(e){if("string"!=typeof e)throw new Error("Path type must be string");if(!e.match(/gr_sw_main.js|service-worker\/service-worker.js$/))throw new Error("Invalid sw file name");window.__grIntegrationConfig.webPush.customSwPath=e}getCustomSwPath(){var e;return null==(e=window.__grIntegrationConfig)?void 0:e.webPush.customSwPath}isTrackingEnabled(){return window.__grIntegrationConfig.tracking.isEnabled}isTrackingScriptServedFromCustomDomain(){return window.__grIntegrationConfig.cData.isServedFromCustomDomain}set visitorEmail(e){window.__grIntegrationConfig.visitor.email=e}get visitorEmail(){return window.__grIntegrationConfig.visitor.email}get pushWpid(){return window.__grIntegrationConfig.webPush.wpid}set pushWpid(e){window.__grIntegrationConfig.webPush.wpid=e}set pushDomain(e){window.__grIntegrationConfig.webPush.pushDomain=e}get pushDomain(){return window.__grIntegrationConfig.webPush.pushDomain}set pushPromptEndpoint(e){window.__grIntegrationConfig.webPush.promptEndpoint=e}get pushPromptEndpoint(){return window.__grIntegrationConfig.webPush.promptEndpoint}get eventBus(){return window.__grIntegrationConfig.eventBus}get canUseBackendStorageForEvents(){return window.__grIntegrationConfig.cData.useNOStorage}get webConnectScriptCdnUrl(){return window.__grIntegrationConfig.analyticsData.scriptsDomain}get webConnectCurrentScriptsVersion(){return window.__grIntegrationConfig.analyticsData.scriptsVersion}get isDebug(){var e,t;return!!(null==(t=null==(e=window.__grIntegrationConfig)?void 0:e.debug)?void 0:t.enabled)}set debugObject(e){window.__grIntegrationConfig.debug=e}get debugObject(){var e;return null==(e=window.__grIntegrationConfig)?void 0:e.debug}get delayedScripts(){var e;return(null==(e=window.__grIntegrationConfig)?void 0:e.delayedScripts)||{}}set delayedScripts(e){window.__grIntegrationConfig.delayedScripts=e}set visitorApplicationEndpoint(e){window.__grIntegrationConfig.webEvents.visitorApplicationEndpoint=e}get visitorApplicationEndpoint(){return window.__grIntegrationConfig.webEvents.visitorApplicationEndpoint}get userEventsStorageApplicationUrl(){return window.__grIntegrationConfig.ecommerce.webEventsSearchApplicationEndpoint}set userEventsStorageApplicationUrl(e){window.__grIntegrationConfig.ecommerce.webEventsSearchApplicationEndpoint=e}get temporaryEventsStorage(){return window.__grIntegrationConfig.temporaryEventsStorage}get automationJourneyGraphs(){return window.__grIntegrationConfig.webEvents.automationJourneyGraphs}get webPushActivePromptGraph(){return window.__grIntegrationConfig.webEvents.webPushActivePromptGraph}set webPushActivePromptGraph(e){window.__grIntegrationConfig.webEvents.webPushActivePromptGraph=e}get popupGraphs(){return window.__grIntegrationConfig.webEvents.popupGraphs}get visitorXsid(){return window.__grIntegrationConfig.visitor.xsid}},pe=204,ve=new class{retrieveXsid(){return((e,t)=>{const r=e.isTextResponse??(null==t?void 0:t.isTextResponse);return fetch(e,{...t,headers:{...null==t?void 0:t.headers,...(null==t?void 0:t.omitAidHeader)?{}:{[ee.UserAid]:ge.getUserAid()}}}).then((async e=>{if(e.ok){if(e.status===pe)return;return r?e.text():e.json()}const t=await e.text();return Promise.reject({statusCode:e.status,message:t})}))})(new URL("retrieveXsid",ge.getUserAnalyticsDomain()).href,{isTextResponse:true,omitAidHeader:true,credentials:"include"})}},he=new Map,we=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter((e=>{if("string"!=typeof e){if(void 0===e)return false;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof e}' in the array`)}return true}))};function me(e,t,r){return((e,t,r,i)=>{if(e=we(e,"inputs"),0===(t=we(t,"patterns")).length)return[];t=t.map((e=>((e,t)=>{t={caseSensitive:false,...t};const r=e+JSON.stringify(t);if(he.has(r))return he.get(r);const i="!"===e[0];if(i)e=e.slice(1);e=(e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")})(e).replace(/\\\*/g,"[\\s\\S]*");const n=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return n.negated=i,he.set(r,n),n})(e,r)));const{allPatterns:n}=r||{},s=[];for(const o of e){let e;const r=[...t].fill(false);for(const[i,n]of t.entries())if(n.test(o))if(r[i]=true,e=!n.negated,!e)break;if(!(false===e||void 0===e&&t.some((e=>!e.negated))||n&&r.some(((e,r)=>!e&&!t[r].negated))))if(s.push(o),i)break}return s})(e,t,r,true).length>0}var fe,ye,Se,be,Ie,Ee,Ce,De,Pe,Te,Ve,ke,_e,Ue,xe,Ae,Le,Oe,Ne,Fe,Be,Re,We,$e,je,Me,ze,Je,Ge,qe,He,Xe,Ke,Ye,Ze,Qe,et,tt,rt,it;(it=fe||(fe={}))["ShowWhenCondition"]="showWhenCondition",it["VisitorsCondition"]="visitors",it["DeviceCondition"]="device",it["LocationCondition"]="location",it["ECommerceCondition"]="ecommerce",it["TriggerFrequency"]="frequency",it["PreventDisplay"]="preventDisplay",void(it["DateRange"]="dateRange"),(rt=ye||(ye={}))["Mobile"]="mobile",rt["Tablet"]="tablet",void(rt["Desktop"]="desktop"),(tt=Se||(Se={}))["All"]="all",tt["New"]="new",void(tt["Returning"]="returning"),void((be||(be={}))["All"]="all"),(et=Ie||(Ie={}))["ConditionsLogicSeparator"]="conditionsLogicSeparator",void(et["ECommerceConditions"]="ecommerceConditions"),(Qe=Ee||(Ee={}))["Amount"]="amount",void(Qe["Date"]="date"),(Ze=Ce||(Ce={}))["And"]="and",void(Ze["Or"]="or"),(Ye=De||(De={}))["Exactly"]="exactly",Ye["LessThan"]="lessThan",void(Ye["MoreThan"]="moreThan"),(Ke=Pe||(Pe={}))["LastDays"]="lastDays",void(Ke["DateRange"]="dateRange"),(Xe=Te||(Te={}))["AnyProduct"]="any",Xe["AnyCategory"]="any",Xe["AnyProductLiked"]="any",Xe["AnyProductInPlacedOrder"]="any",Xe["AnyCategoryInPlacedOrder"]="any",Xe["AnyProductInUpdatedCart"]="any",void(Xe["AnyCategoryInUpdatedCart"]="any"),(He=Ve||(Ve={}))["PastEvents"]="filter",void(He["FutureEvents"]="await"),(qe=ke||(ke={}))["Category"]="category",void(qe["Product"]="product"),void((_e||(_e={}))["Product"]="product"),(Ge=Ue||(Ue={}))["ViewProductOrCategory"]="productOrCategoryView",Ge["LikeProduct"]="likeItem",Ge["OrderPlaced"]="orderPlaced",void(Ge["CartUpdated"]="cartUpdated"),(Je=xe||(xe={}))["Percent"]="percent",void(Je["Selector"]="selector"),(ze=Ae||(Ae={}))["Instantly"]="instantly",ze["Delay"]="delay",ze["Exit"]="exit",ze["Scroll"]="scroll",ze["Inactivity"]="inactivity",void(ze["Click"]="click"),(Me=Le||(Le={}))["AfterSubmit"]="submit",Me["AfterClose"]="close",void(Me["AfterTimes"]="timesAmount"),(je=Oe||(Oe={}))["Always"]="always",je["Session"]="session",void(je["EveryDays"]="everyDays"),($e=Ne||(Ne={}))["Exactly"]="equal",$e["LessThan"]="lessThan",void($e["MoreThan"]="moreThan"),(We=Fe||(Fe={}))["Exactly"]="equal",We["LessThan"]="lessThan",void(We["MoreThan"]="moreThan"),(Re=Be||(Be={}))[Re["InvalidCssSelector"]=1]="InvalidCssSelector",Re[Re["EmptyCssSelector"]=2]="EmptyCssSelector",Re[Re["CssSelectorTooLong"]=3]="CssSelectorTooLong",Re[Re["CssInvalidType"]=4]="CssInvalidType",Re[Re["InvalidTimeoutProperty"]=5]="InvalidTimeoutProperty",Re[Re["ShowWhenScrollPercentInvalidValueType"]=6]="ShowWhenScrollPercentInvalidValueType",Re[Re["ShowWhenScrollPercentValueOutOfBound"]=7]="ShowWhenScrollPercentValueOutOfBound",Re[Re["VisitorTriggerEmpty"]=8]="VisitorTriggerEmpty",Re[Re["VisitorTriggerInvalidProperty"]=9]="VisitorTriggerInvalidProperty",Re[Re["DevicesTriggerEmpty"]=10]="DevicesTriggerEmpty",Re[Re["DevicesTriggerInvalidValue"]=11]="DevicesTriggerInvalidValue",Re[Re["FrequencyEmptyTrigger"]=12]="FrequencyEmptyTrigger",Re[Re["FrequencyTriggerInvalidName"]=13]="FrequencyTriggerInvalidName",Re[Re["FrequencyTriggerNDaysInvalidPropertyValue"]=14]="FrequencyTriggerNDaysInvalidPropertyValue",Re[Re["FrequencyTriggerNDaysEmptyValue"]=15]="FrequencyTriggerNDaysEmptyValue",Re[Re["PreventDisplayTriggerInvalidName"]=16]="PreventDisplayTriggerInvalidName",Re[Re["PreventDisplayTriggerAfterTimesNoValue"]=17]="PreventDisplayTriggerAfterTimesNoValue",Re[Re["PreventDisplayTriggerAfterTimesInvalidValue"]=18]="PreventDisplayTriggerAfterTimesInvalidValue",Re[Re["DateRangeInvalidFromDate"]=19]="DateRangeInvalidFromDate",Re[Re["DateRangeInvalidToDate"]=20]="DateRangeInvalidToDate",Re[Re["DateRangeDateFromAfterDateTo"]=21]="DateRangeDateFromAfterDateTo",Re[Re["LocationEmptyTrigger"]=22]="LocationEmptyTrigger",Re[Re["LocationInvalidType"]=23]="LocationInvalidType",Re[Re["LackOfLogicSeparator"]=24]="LackOfLogicSeparator",Re[Re["LackOfTriggerConditions"]=25]="LackOfTriggerConditions",Re[Re["InvalidTriggerConditions"]=26]="InvalidTriggerConditions",Re[Re["NoProductOrCategorySelected"]=27]="NoProductOrCategorySelected",Re[Re["ProductInvalidType"]=28]="ProductInvalidType",Re[Re["CategoryInvalidType"]=29]="CategoryInvalidType",Re[Re["AmountInvalidConditionName"]=30]="AmountInvalidConditionName",Re[Re["AmountInvalidConditionValueType"]=31]="AmountInvalidConditionValueType",Re[Re["DateInvalidConditionName"]=32]="DateInvalidConditionName",Re[Re["DateLastDaysInvalidConditionValue"]=33]="DateLastDaysInvalidConditionValue",Re[Re["DateDateRangeInvalidConditionValue"]=34]="DateDateRangeInvalidConditionValue",Re[Re["DateDateRangeFromInvalidValue"]=35]="DateDateRangeFromInvalidValue",Re[Re["DateDateRangeToInvalidValue"]=36]="DateDateRangeToInvalidValue",Re[Re["DateDateRangeDateFromAfterDateTo"]=37]="DateDateRangeDateFromAfterDateTo",Re[Re["PopupTriggerInvalidName"]=38]="PopupTriggerInvalidName",Re[Re["PopupTriggerLackOfValuesInLikeItemTrigger"]=39]="PopupTriggerLackOfValuesInLikeItemTrigger",Re[Re["PopupTriggerLikeItemInvalidValues"]=40]="PopupTriggerLikeItemInvalidValues",Re[Re["PopupTriggerOrderPlacedNoConditions"]=41]="PopupTriggerOrderPlacedNoConditions",Re[Re["PopupTriggerOrderPlacedInvalidProducts"]=42]="PopupTriggerOrderPlacedInvalidProducts",Re[Re["PopupTriggerOrderPlacedInvalidCategories"]=43]="PopupTriggerOrderPlacedInvalidCategories",Re[Re["PopupTriggerCartUpdatedNoConditions"]=44]="PopupTriggerCartUpdatedNoConditions",Re[Re["PopupTriggerCartUpdatedInvalidProducts"]=45]="PopupTriggerCartUpdatedInvalidProducts",Re[Re["PopupTriggerCartUpdatedInvalidCategories"]=46]="PopupTriggerCartUpdatedInvalidCategories",Re[Re["PopupTriggerPriceValueConditionInvalidComparator"]=47]="PopupTriggerPriceValueConditionInvalidComparator",Re[Re["PopupTriggerPriceValueConditionInvalidValue"]=48]="PopupTriggerPriceValueConditionInvalidValue",Re[Re["PopupTriggerProductsAmountValueConditionInvalidComparator"]=49]="PopupTriggerProductsAmountValueConditionInvalidComparator",Re[Re["PopupTriggerProductsAmountValueConditionInvalidValue"]=50]="PopupTriggerProductsAmountValueConditionInvalidValue",void(Re[Re["PopupTriggerInvalidTriggerType"]=51]="PopupTriggerInvalidTriggerType");class nt extends Error{constructor(e){super(e),Object.setPrototypeOf(this,new.target.prototype),this.name=this.constructor.name}}class st extends nt{constructor(){super("Failed to parse data from JSON string")}}var ot=(e=>(e["visitorUuid"]="gaVisitorUuid",e["visitorValuable"]="gaIsValuable",e["VisitorEmail"]="gaVisitorEId",e["VisitorResubscribed"]="gaVisitorResubscribed",e["NotificationConsentAcceptedFromPrompt"]="gaWpnConAcc",e["NotificationConsentCustomPromptRejectedDEPRECATED"]="gaWpnConRej-{promptId}",e["NotificationConsentCustomPromptRejected"]="gaWpnConRej-promptId",e))(ot||{}),at=(e=>(e[e["OneYear"]=31536e6]="OneYear",e[e["TwoWeeks"]=12096e5]="TwoWeeks",e[e["ThreeMonths"]=7776e6]="ThreeMonths",e))(at||{}),ct=(e=>(e["Show"]="show",e["Close"]="close",e["Submit"]="submit",e))(ct||{}),ut=(e=>(e["One"]="1.0",e))(ut||{}),lt=(e=>(e["Web"]="web",e["Mobile"]="mobile",e))(lt||{});const dt=new class{constructor(){this.timer=Date.now()}getCurrentVisitOnPageTime(){return Date.now()-this.timer}};var gt=(e=>(e[e["Mobile"]=480]="Mobile",e[e["Tablet"]=768]="Tablet",e))(gt||{});const pt=Symbol("DeviceService");class vt{constructor(e){if(new.target===vt&&e!==pt)throw new Error(`Invalid ${new.target.name} constructor`)}detectDeviceTypeByScreenWidth(e){var t;const{availWidth:r,availHeight:i}=screen;let n=null==(t=screen.orientation)?void 0:t.type;if(!n)n=window.matchMedia("(orientation: landscape)").matches?"landscape":"portrait";const s=n.match(/landscape/)?i:r;if(gt.Mobile>=s)return ye.Mobile;else if(s>gt.Mobile&>.Tablet>=s)return ye.Tablet;return e?ye.Tablet:ye.Desktop}isDesktopDevice(){return this.getDeviceType()===ye.Desktop}getDeviceType(){const{userAgentData:e}=window.navigator;if(e){const{mobile:t}=e;if(t)return this.detectDeviceTypeByScreenWidth(true);else return ye.Desktop}return this.detectDeviceTypeByScreenWidth()}getBrowserLanguage(){const{language:e}=window.navigator;if(e.match(/\w{2}-\w{2}/))return e.split("-")[0].toLowerCase();else return e.toLowerCase()}getUserOs(){const{userAgentData:e}=window.navigator;if(e)return e.platform.toLowerCase();else return this.getOsFromUserAgent()}getOsFromUserAgent(){let e="unknown";const{userAgent:t}=navigator,r=t.toLowerCase();if(r.includes("win"))e="windows";if(r.includes("mac"))e="macos";if(r.includes("x11"))e="unix";if(r.includes("linux"))e="Linux";if(r.includes("android"))e="android";if(/iphone|ipad|ipod/.test(r))e="ios";return e}}const ht=new vt(pt),wt=new class{encodeEmail(e){return btoa(e)}decode(e){return atob(e)}isEncodedString(e){try{return atob(e),true}catch{return false}}validateEmail(e){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(e)}};class mt extends Error{constructor(e){super(e)}static create(...[e,t]){switch(e){case"email":return new mt(`Provided string ${t} is not valid email address`);default:void V.error(`Unsupported value: ${e}`)}}}class ft{constructor({e}={}){if(e)this.e=wt.encodeEmail(e)}static createFromContextData(e){try{if(wt.isEncodedString(e.e))e.e=wt.decode(e.e);return ft.validate(e),new ft(e)}catch(t){if(t instanceof mt)return V.error(t),ft.createBlank();throw t}}static createBlank(){return new ft}static validate(e){if("e"in e&&!wt.validateEmail(e.e))throw mt.create("email",e.e)}toJSON(){return{...this}}}class yt{constructor(e){I(this,a,void 0),this.eventType=e,E(this,a,null),this.eventId=null,this.aid=ge.getUserAid(),this.grid=ge.getClientLatestGrid(),this.time=dt.getCurrentVisitOnPageTime(),this.context=ft.createBlank(),this.uuid=k(ot.visitorUuid),this.url=window.location.href,this.occurredOn=new Date,this.tags=[]}get externalUid(){return b(this,a)}toJSON(){return{eventId:this.eventId,aid:this.aid,grid:this.aid,uuid:this.uuid,externalUid:this.externalUid,context:this.context.toJSON(),time:this.time,url:this.url,tags:this.tags,eventType:this.eventType,occurredOn:this.occurredOn.toUTCString()}}toString({normalized:e}={}){if(e)return JSON.stringify(this.normalizeForExternalStorage());else return JSON.stringify(this.toJSON())}normalize(){const{eventId:e,...t}=this.toJSON();return t}getBaseNormalizedEvent(){return{version:ut.One,user_uuid:ge.getUserUuid(),time:this.time,tags:this.tags,occurred_on:this.occurredOn.toISOString(),url:this.url,app:{lang:ht.getBrowserLanguage(),device:ht.getDeviceType(),os:ht.getUserOs()},channel:lt.Web,visitor:{uuid:this.uuid,external_id:this.externalUid,xsid:ge.visitorXsid}}}}a=new WeakMap;class St extends yt{constructor(e,t,r=ft.createBlank()){super($.Popup),this.popupEvent=e,this.popupId=t,this.context=r}toJSON(){return{...super.toJSON(),popupId:this.popupId,popupEvent:this.popupEvent}}normalizeForExternalStorage(){return{...this.getBaseNormalizedEvent(),event:{version:"1.0",name:$.Popup}}}}class bt extends yt{toJSON(){return{...super.toJSON(),data:this.data}}normalizeForExternalStorage(){const e=this.getBaseNormalizedEvent();return{...e,event:{version:this.eventVersion,name:this.eventType,data:this.data},visitor:{uuid:e.visitor.uuid,external_id:e.visitor.external_id}}}}class It extends yt{constructor(e){super($.ShopifyAbandonedCart),this.data=e}toJSON(){return{...super.toJSON(),data:this.data}}normalizeForExternalStorage(){return{...this.getBaseNormalizedEvent(),event:{version:"1.0",name:$.ShopifyAbandonedCart,data:this.data}}}}const Et=class e{constructor(e){I(this,c,void 0),E(this,c,e)}static create(t){return new e(t)}validate(e){return Object.entries(b(this,c)).reduce(((t,[r,i])=>{if(false===t)return t;if(null==e[r]&&i._isOptional)return t;else return i.call(e,e[r])}),true)}stringifySchemaShape(){var t;return C(t=e,u,l).call(t,b(this,c))}trim(e,t=b(this,c)){var r;const i={};for(const[n,s]of Object.entries(e))if("object"==typeof s&&null!==s){if(n in t){const e=null==(r=t[n])?void 0:r.valueShape;if(Array.isArray(s))if(e)i[n]=s.map((t=>this.trim(t,e)));else i[n]=s;else i[n]=this.trim(s,e)}}else if(n in t)i[n]=s;return i}static string(){return Dt((e=>"string"==typeof e),(()=>"string"))}static number(){return Dt((e=>"number"==typeof e),(()=>"number"))}static boolean(){return Dt((e=>"boolean"==typeof e),(()=>"boolean"))}static dateString(){return Dt((e=>{if("string"!=typeof e)return false;else return!Number.isNaN(new Date(e).getTime())}),(()=>"date string"))}static object(t){return Dt((r=>{if(!t||"object"!=typeof t)return false;else return e.create(t).validate(r)}),(()=>C(this,u,l).call(this,t)),t)}static array(t){return Dt((r=>{if(!Array.isArray(r))return false;if("function"==typeof t)return r.every((e=>t(e)));const i=e.create(t);return r.every((e=>i.validate(e)))}),(()=>`[${C(this,u,l).call(this,t)}]`),"function"==typeof t?void 0:t)}};c=new WeakMap,u=new WeakSet,l=e=>{const t={};if("function"==typeof e)return e.getValueType();else for(const[r,i]of Object.entries(e))t[r]=i.getValueType();try{return JSON.stringify(t).replaceAll('\\"','"')}catch{return"Failed to parse validation shape"}},I(Et,u);let Ct=Et;function Dt(e,t,r){if(e.optional=()=>(e._isOptional=true,e),e.getValueType=t,r)e.valueShape=r;return e}const Pt={id:Ct.string(),sku:Ct.string().optional(),name:Ct.string().optional(),vendor:Ct.string().optional(),price:Ct.string().optional(),currency:Ct.string().optional()},Tt=Ct.array({id:Ct.string(),name:Ct.string().optional()}).optional(),Vt={id:Ct.string()},kt={shop:Ct.object({...Vt}).optional(),product:Ct.object({...Pt}),categories:Tt},_t={product:Ct.object({...Pt}),categories:Tt,quantity:Ct.number()},Ut=Ct.create({...kt}),xt=Ct.create({shop:Ct.object({...Vt}).optional(),id:Ct.string(),name:Ct.string().optional()}),At=Ct.create({...kt}),Lt=Ct.create({...kt}),Ot=Ct.create({...kt}),Nt=Ct.create({orderId:Ct.string(),cartId:Ct.string().optional(),price:Ct.number(),currency:Ct.string(),products:Ct.array(_t)}),Ft=Ct.create({price:Ct.number(),cartId:Ct.string(),cartUrl:Ct.string(),currency:Ct.string(),products:Ct.array(_t)});class Bt extends Error{constructor(e){super(`Data doesn't match required schema: ${e}`)}}class Rt extends yt{constructor(e=ft.createBlank()){super($.PageVisit),this.context=e}normalizeForExternalStorage(){return{...this.getBaseNormalizedEvent(),event:{version:"1.0",name:this.eventType}}}}const Wt={[$.ViewItem]:Ut,[$.ViewCategory]:xt,[$.WishlistItem]:At,[$.LikeItem]:Lt,[$.UnlikeItem]:Ot,[$.OrderPlaced]:Nt,[$.Cart]:Ft},$t={[$.ViewItem]:class extends bt{constructor(e,t){super($.ViewItem),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.event.data.product.price=parseFloat(e.event.data.product.price),e.time=dt.getCurrentVisitOnPageTime(),e}},[$.ViewCategory]:class extends bt{constructor(e,t){super($.ViewCategory),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.time=dt.getCurrentVisitOnPageTime(),e}},[$.WishlistItem]:class extends bt{constructor(e,t){super($.WishlistItem),this.data=e,this.context=t,this.eventVersion="1.0"}},[$.LikeItem]:class extends bt{constructor(e,t){super($.LikeItem),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.event.data.product.price=parseFloat(e.event.data.product.price),e}},[$.UnlikeItem]:class extends bt{constructor(e,t){super($.UnlikeItem),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.event.data.product.price=parseFloat(e.event.data.product.price),e}},[$.OrderPlaced]:class extends bt{constructor(e,t){super($.OrderPlaced),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.event.data.products=e.event.data.products.map((e=>({...e,product:{...e.product,price:parseFloat(e.product.price)}}))),e}},[$.Cart]:class extends bt{constructor(e,t){super($.Cart),this.data=e,this.context=t,this.eventVersion="1.0"}normalizeForExternalStorage(){const e=super.normalizeForExternalStorage();return e.event.data.products=e.event.data.products.map((e=>({...e,product:{...e.product,price:parseFloat(e.product.price)}}))),e}}},jt=class e{static getPageVisitEvent(){return new Rt}static getPopupEvent({popupId:e,popupEventName:t}){return new St(t,e)}static getPopupSubmitEvent(e){return new St(ct.Submit,e)}static getPopupShowEvent(e){return new St(ct.Show,e)}static getPopupCloseEvent(e){return new St(ct.Close,e)}static getViewItemEvent(t,r){var i;return C(i=e,d,g).call(i,$.ViewItem,t,r)}static getWishlistItemEvent(t,r){var i;return C(i=e,d,g).call(i,$.WishlistItem,t,r)}static getLikeItemEvent(t,r){var i;return C(i=e,d,g).call(i,$.LikeItem,t,r)}static getUnlikeItemEvent(t,r){var i;return C(i=e,d,g).call(i,$.UnlikeItem,t,r)}static getViewCategoryEvent(t,r){var i;return C(i=e,d,g).call(i,$.ViewCategory,t,r)}static getOrderPlacedEvent(t,r){var i;return C(i=e,d,g).call(i,$.OrderPlaced,t,r)}static getCartUpdateEvent(t,r){var i;return C(i=e,d,g).call(i,$.Cart,t,r)}static getShopifyIntegrationAbandonedCartEvent(e){try{return(e=>{if("object"!=typeof e||null===e)throw new X("Invalid data parameter type");else{const t=Object.entries(K),r=Object.keys(e);if(!Y.every((e=>r.includes(e))))throw new X("Lack of required parameters");if(!t.every((([t,r])=>!e[t]||typeof e[t]===r)))throw new X("Properties have invalid type")}return true})(e),new It((t=e,r=Object.keys(K),Object.entries(t).reduce(((e,[t,i])=>{if(r.includes(t))e[t]=i;return e}),{})))}catch(i){return V.error(i),null}var t,r}};d=new WeakSet,g=(e,t,r)=>{const i=Wt[e],n=$t[e];if(!i||!n)throw new Error("Event type not supported in event factory");if(!i.validate(t))throw new Bt(i.stringifySchemaShape());return new n(i.trim(t),r)},I(jt,d);let Mt=jt;const zt=Symbol("StorageService");class Jt{constructor(e){if(new.target===Jt&&e!==zt)throw new Error(`Invalid ${new.target.name} constructor`)}async isNewVisitor(){return!(await this.getLastActivityDate())}getLastActivityDate(){return this.getLastActivityDateFromBrowserStorage()}getUserActivityDataFromBrowserStorage(){const e=k(ot.visitorUuid),t=localStorage.getItem("gaLocalStorageVisitKey");let r;try{r=JSON.parse(t)}catch{throw new st}if(null==r?void 0:r[e])return r[e];else return{lastActivity:null,totalCount:1}}async getLastActivityDateFromBrowserStorage(){const{lastActivity:e}=await this.getUserActivityDataFromBrowserStorage();if(e)return Promise.resolve(new Date(e));else return null}saveUserActivity(){ge.eventBus.publish(L.SaveEvent,{sendToBackend:true,saveToLocal:false},ft.createBlank(),$.PageVisit,null),this.saveUserActivityToBrowserStorage()}saveUserActivityToBrowserStorage(){const e=k(ot.visitorUuid),{totalCount:t}=this.getUserActivityDataFromBrowserStorage(),r={[e]:{lastActivity:Mt.getPageVisitEvent().occurredOn.toUTCString(),totalCount:t+1}};try{window.localStorage.setItem("gaLocalStorageVisitKey",JSON.stringify(r))}catch{throw new st}}}const Gt=new Jt(zt),qt=Symbol("DebugStorageService");class Ht extends Jt{constructor(e){if(super(),new.target===Ht&&e!==qt)throw new Error(`Invalid ${new.target.name} constructor`)}getLastActivityDate(){var e;const t=G(M.BrowserStorageLastActivityDate);if(isNaN(null==(e=null==t?void 0:t.getTime)?void 0:e.call(t)))return super.getLastActivityDate();else return Promise.resolve(t)}setLastActivityDate(e){const t=new Date(e);if(isNaN(t.getTime()))return V.error("Incorrect dateString for last activity date. Try again with isoString."),null;J(M.BrowserStorageLastActivityDate,t,t.toISOString())}isNewVisitor(){const e=G(M.NewVisitor);if(void 0===e)return super.isNewVisitor();else return Promise.resolve(e)}setIsNewVisitor(e){J(M.NewVisitor,e,String(e))}}const Xt=new Ht(qt);function Kt(){return q(Gt,Xt)}var Yt=(e=>(e["Always"]="always",e["OnceEveryDays"]="xDays",e["Session"]="everySession",e["LessThanXTimes"]="lessThanXTimes",e["ExactlyXTimes"]="exactlyXTimes",e["MoreThanXTimes"]="moreThanXTimes",e))(Yt||{});const Zt=1e3*60*60*24,Qt=Symbol("SessionService");class er{constructor(e){if(new.target===er&&e!==Qt)throw new Error(`Invalid ${new.target.name} constructor`)}hasUserVisitedPage(){return this.getSessionVisitData().count>1}saveUserVisit(){const e=this.getSessionVisitData()||{count:0};sessionStorage.setItem("gaUserPageSessionVisit",JSON.stringify({...e,count:e.count+1}))}getSessionVisitData(){return JSON.parse(sessionStorage.getItem("gaUserPageSessionVisit"))}}const tr=new er(Qt),rr=Symbol("DebugSessionService");class ir extends er{constructor(e){if(super(),new.target===ir&&e!==rr)throw new Error(`Invalid ${new.target.name} constructor`)}hasUserVisitedPage(){const e=G(M.HasUserVisitPage);if(void 0===e)return super.hasUserVisitedPage();else return e}setHasUserVisitedPage(e){J(M.HasUserVisitPage,e)}}const nr=new ir(rr);function sr(){return q(tr,nr)}const or=Symbol("VisitService");class ar{constructor(e){if(new.target===ar&&e!==or)throw new Error(`Invalid ${new.target.name} constructor`)}async validateFrequencyProperty(e,t=0){if(e===Yt.Session)return!sr().hasUserVisitedPage();if(e===Yt.OnceEveryDays){const e=await Kt().getLastActivityDate();if(e)return((e,t)=>{const r=new Date(e+t*Zt),i=new Date(r.getFullYear(),r.getMonth(),r.getDate(),0,0,0);return Date.now()>=Date.parse(i.toString())})(e.getTime(),t)}const{totalCount:r}=Kt().getUserActivityDataFromBrowserStorage();if(e===Yt.ExactlyXTimes)return t===r;if(e===Yt.LessThanXTimes)return t>r;if(e===Yt.MoreThanXTimes)return r>t;else return true}async validateVisitorsProperty(e){const t=await Kt().isNewVisitor();switch(e){case Se.New:return t;case Se.Returning:return!t;default:return true}}validateUrlPath(e="*"){const t=window.location.pathname;return this.validatePath(e,t)}validatePath(e,t){return me(t,e)}}const cr=new ar(or),ur=Symbol("DebugVisitService");class lr extends ar{constructor(e){if(super(),new.target===lr&&e!==ur)throw new Error(`Invalid ${new.target.name} constructor`)}validateUrlPath(e="*"){const t=G(M.VisitUrlPath);if(void 0===t)return super.validateUrlPath(e);else return super.validatePath(e,t)}setVisitPathUrl(e){if("string"!=typeof e)return V.error("Invalid url path type. Try again with string variable"),null;J(M.VisitUrlPath,e)}}const dr=new lr(ur),gr=Symbol("DebugDeviceService");class pr extends vt{constructor(e){if(super(),new.target===pr&&e!==gr)throw new Error(`Invalid ${new.target.name} constructor`)}getDeviceType(){const e=G(M.DeviceType);if(!e)return super.getDeviceType();if(!Object.values(ye).includes(e))return V.error("Incorrect debug device type. Check if device is correct. Instead of that we will use normal values"),super.getDeviceType();else return e}setDeviceType(e){J(M.DeviceType,e)}}const vr=new pr(gr),hr=Symbol("LocationService");class wr{constructor(e){if(new.target===wr&&e!==hr)throw new Error(`Invalid ${new.target.name} constructor`)}getVisitorCountryCode(){const{domain:e}=window.__grIntegrationConfig.cData;return fetch(`${e}web-user-data/country`).then((e=>e.text()))}}const mr=new wr(hr),fr=Symbol("DebugLocationService");class yr extends wr{constructor(e){if(super(),new.target===yr&&e!==fr)throw new Error(`Invalid ${new.target.name} constructor`)}getVisitorCountryCode(){const e=G(M.Location);if(!e)return super.getVisitorCountryCode();else return Promise.resolve(e)}setVisitorCountryCode(e){if("string"!=typeof e)return V.error("Incorrect debug country code value"),null;J(M.Location,e)}}const Sr=new yr(fr);class br{static sendJSON(e,t,r=true){const i=r?JSON.stringify({...JSON.parse(t),[ee.UserAid]:ge.getUserAid()}):t;navigator.sendBeacon(e,new Blob([i],{type:"application/json"}))}}const Ir=[$.OrderPlaced,$.Cart,$.LikeItem,$.UnlikeItem,$.WishlistItem,$.ViewItem,$.ViewCategory],Er=[$.Cart,$.LikeItem,$.UnlikeItem,$.OrderPlaced,$.ViewCategory,$.ViewItem];p=new WeakSet,v=()=>new URL(`u/${ge.getUserUuid()}/e/${lt.Web}/handle/`,ge.userEventsStorageApplicationUrl).href;const Cr=new class{constructor(){I(this,p)}async addPopupEventToStorage(e){throw new Error("Not implemented")}async getPopupActivityData(e){throw new Error("Not implemented")}async saveEventsToStorage(e){if(ge.userEventsStorageApplicationUrl&&ge.getUserUuid()){const t=e.filter((e=>Ir.includes(e.event.name)));if(t.length>0)br.sendJSON(C(this,p,v).call(this),JSON.stringify(t),false)}else V.error("Attempt to send web events to search was made without search application endpoint or uuuid!")}async sendEventsToMetricsInc(e){const t=e.filter((e=>Er.includes(e.event.name)));if(t.length>0){const e=JSON.stringify({events:t.map((e=>({eventType:e.event.name}))),url:window.location.origin}),r=new URL("/a/ue",ge.getUserAnalyticsDomain()).href;br.sendJSON(r,e)}}};var Dr=(e=>(e["Events"]="gr_webconnect",e["VisitorJourneys"]="gr_visitor_journeys",e["ServiceWorkerCallbacks"]="gr_sw_callbacks",e))(Dr||{});const Pr={gr_webconnect:1,gr_visitor_journeys:2,gr_sw_callbacks:1};var Tr=(e=>(e["UserActivityEvents"]="user_activity_events",e))(Tr||{}),Vr=(e=>(e["EventType"]="eventType",e["VisitorUuid"]="visitorUuid",e["EventTypeWithVisitor"]="eventType, visitorUuid",e))(Vr||{});let kr,_r;const Ur=new WeakMap,xr=new WeakMap,Ar=new WeakMap,Lr=new WeakMap,Or=new WeakMap;let Nr={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return xr.get(e);if("objectStoreNames"===t)return e.objectStoreNames||Ar.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Br(e[t])},set:(e,t,r)=>(e[t]=r,true),has(e,t){if(e instanceof IDBTransaction&&("done"===t||"store"===t))return true;else return t in e}};function Fr(e){if("function"==typeof e)return function(e){if(e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype))return function(t,...r){const i=e.call(Rr(this),t,...r);return Ar.set(i,t.sort?t.sort():[t]),Br(i)};if((_r||(_r=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e))return function(...t){return e.apply(Rr(this),t),Br(Ur.get(this))};else return function(...t){return Br(e.apply(Rr(this),t))}}(e);if(e instanceof IDBTransaction)!(e=>{if(xr.has(e))return;const t=new Promise(((t,r)=>{const i=()=>{e.removeEventListener("complete",n),e.removeEventListener("error",s),e.removeEventListener("abort",s)},n=()=>{t(),i()},s=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",n),e.addEventListener("error",s),e.addEventListener("abort",s)}));xr.set(e,t)})(e);if(t=e,(kr||(kr=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some((e=>t instanceof e)))return new Proxy(e,Nr);else return e;var t}function Br(e){if(e instanceof IDBRequest)return(e=>{const t=new Promise(((t,r)=>{const i=()=>{e.removeEventListener("success",n),e.removeEventListener("error",s)},n=()=>{t(Br(e.result)),i()},s=()=>{r(e.error),i()};e.addEventListener("success",n),e.addEventListener("error",s)}));return t.then((t=>{if(t instanceof IDBCursor)Ur.set(t,e)})).catch((()=>{})),Or.set(t,e),t})(e);if(Lr.has(e))return Lr.get(e);const t=Fr(e);if(t!==e)Lr.set(e,t),Or.set(t,e);return t}const Rr=e=>Or.get(e),Wr=["get","getKey","getAll","getAllKeys","count"],$r=["put","add","delete","clear"],jr=new Map;function Mr(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(jr.get(t))return jr.get(t);const r=t.replace(/FromIndex$/,""),i=t!==r,n=$r.includes(r);if(!(r in(i?IDBIndex:IDBObjectStore).prototype)||!(n||Wr.includes(r)))return;const s=async function(e,...t){const s=this.transaction(e,n?"readwrite":"readonly");let o=s.store;if(i)o=o.index(t.shift());return(await Promise.all([o[r](...t),n&&s.done]))[0]};return jr.set(t,s),s}var zr;zr=Nr,void(Nr={...zr,get(e,t,r){return Mr(e,t)||zr.get(e,t,r)},has(e,t){return!!Mr(e,t)||zr.has(e,t)}});const Jr=new class{openEventsDatabaseConnection(e){return this.openConnection(Dr.Events,Pr[Dr.Events],e)}openAutomationJourneysDatabaseConnection(e){return this.openConnection(Dr.VisitorJourneys,Pr[Dr.VisitorJourneys],e)}openServiceWorkerCallbacksDatabaseConnection(e){return this.openConnection(Dr.ServiceWorkerCallbacks,Pr[Dr.ServiceWorkerCallbacks],e)}async openConnection(e,t,r){const i=await((e,t,{blocked:r,upgrade:i,blocking:n,terminated:s}={})=>{const o=indexedDB.open(e,t),a=Br(o);if(i)o.addEventListener("upgradeneeded",(e=>{i(Br(o.result),e.oldVersion,e.newVersion,Br(o.transaction),e)}));if(r)o.addEventListener("blocked",(e=>r(e.oldVersion,e.newVersion,e)));return a.then((e=>{if(s)e.addEventListener("close",(()=>s()));if(n)e.addEventListener("versionchange",(e=>n(e.oldVersion,e.newVersion,e)))})).catch((()=>{})),a})(e,t,{blocked(e,t,r){V.error(`Connection to old db version: ${t} not closed. Version ${e} not available`,r)},upgrade(e,t,i){V.log(`New db version ${i} detected, upgrading from ${t}`),r(t,i,e)},terminated(){V.log("Closing db connection")},blocking(e,t,r){V.log(`Current connection od db version ${e} is blocking connection to version ${t}.`,r),i.close()}});return i}};Jr.openServiceWorkerCallbacksDatabaseConnection.bind(Jr),Jr.openAutomationJourneysDatabaseConnection.bind(Jr);const Gr=Symbol("BrowserEventsStorageService");h=new WeakSet,w=(e,t,r)=>{!(e=>{if(!e.objectStoreNames.contains(Tr.UserActivityEvents))try{const t=e.createObjectStore(Tr.UserActivityEvents,{keyPath:"id",autoIncrement:true});t.createIndex(Vr.EventType,"eventType",{unique:false}),t.createIndex(Vr.VisitorUuid,"uuid",{unique:false}),t.createIndex(Vr.EventTypeWithVisitor,["eventType","uuid"])}catch(t){V.error("Error while initializing/upgrading database",t)}})(r)};let qr=class e{constructor(t){if(I(this,h),new.target===e&&t!==Gr)throw new Error(`Invalid ${new.target.name} constructor`)}async saveEvent(e){const t=e instanceof yt?e.normalize():e;try{const e=(await Jr.openEventsDatabaseConnection(C(this,h,w))).transaction(Tr.UserActivityEvents,"readwrite"),r=e.objectStore(Tr.UserActivityEvents),i=await r.add(t);return await e.done,i}catch(r){V.error("Error while saving event to database",r)}}async getEvents(e){const t=k(ot.visitorUuid);try{const r=(await Jr.openEventsDatabaseConnection(C(this,h,w))).transaction(Tr.UserActivityEvents,"readwrite"),i=r.objectStore(Tr.UserActivityEvents).index(Vr.EventTypeWithVisitor),n=await i.getAll([e,t]);return await r.done,n}catch(r){V.error("Error while reading from database",r)}}async updateEvent(e,t){const r=(await Jr.openEventsDatabaseConnection(C(this,h,w))).transaction(Tr.UserActivityEvents,"readwrite").objectStore(Tr.UserActivityEvents),i=await r.get(e);if(i){const e=A(i,t);await r.put(e)}}async getPopupECommerceEvents(e){const t=k(ot.visitorUuid),r=(await Jr.openEventsDatabaseConnection(C(this,h,w))).transaction(Tr.UserActivityEvents,"readwrite").store.index(Vr.VisitorUuid),i=[];let n=await r.openCursor(IDBKeyRange.only(t));for(;n;){const{value:t}=n;if(e(t))i.push(t);n=await n.continue()}return i}};const Hr=new qr(Gr),Xr=Symbol("DebugBrowserEventsStorageService");class Kr extends qr{constructor(e){if(super(),new.target===Kr&&e!==Xr)throw new Error(`Invalid ${new.target.name} constructor`)}async getPopupECommerceEvents(e){const t=G(M.Events)||[];if(!t.length)return super.getPopupECommerceEvents(e);else return t.filter(e)}async getEvents(e){const t=k(ot.visitorUuid),r=G(M.Events)||[];if(!r.length)return super.getEvents(e);else return r.filter((({eventType:r,uuid:i})=>r===e&&i===t))}async saveEvent(e){const t=e instanceof yt?e.toJSON():e,r=[...G(M.Events)||[],t];try{const e=JSON.stringify(r);return J(M.Events,r,e),Math.random()}catch(i){V.error(`Can't parse new debug events. Try again.`)}}}const Yr=new Kr(Xr);function Zr(){return q(Hr,Yr)}const Qr={[$.PageVisit]:Mt.getPageVisitEvent,[$.ViewItem]:Mt.getViewItemEvent,[$.WishlistItem]:Mt.getWishlistItemEvent,[$.LikeItem]:Mt.getLikeItemEvent,[$.UnlikeItem]:Mt.getUnlikeItemEvent,[$.ViewCategory]:Mt.getViewCategoryEvent,[$.OrderPlaced]:Mt.getOrderPlacedEvent,[$.Cart]:Mt.getCartUpdateEvent,[$.Popup]:Mt.getPopupEvent},ei=2e3;m=new WeakMap,f=new WeakSet,y=function(){b(this,m).forEach((([e,t])=>{if(e===$.ViewCategory||e===$.ViewItem)Hr.updateEvent(t,{time:dt.getCurrentVisitOnPageTime()}).catch((e=>{V.error("Failed to update event data",e)}))}))};const ti=new class{constructor(){I(this,f),I(this,m,void 0),this.eventToSend=[],E(this,m,[])}async push(e,t,...[r,i]){if(void 0===e.saveToLocal||e.saveToLocal){const n=this.getEvent(r,i,t);if(n){const t=await Zr().saveEvent(n);if(n.eventId=String(t),b(this,m).push([r,t]),ae.saveEvent(n),!e.preventRenotify)ge.eventBus.publish(O.UserEventSaved,n)}else return V.warn(`Invalid event params`,r,i),void 0}if(e.sendToBackend)this.eventToSend.push([r,i,dt.getCurrentVisitOnPageTime(),t])}flush(){if(this.eventToSend.length){const e=this.eventToSend.map((([e,t,r,i])=>{const n=this.getEvent(e,t,i);if(n)return n.time=r,n.normalizeForExternalStorage();else return null})).filter(Boolean);if(e.length){if(ge.canUseBackendStorageForEvents)Cr.saveEventsToStorage(e);Cr.sendEventsToMetricsInc(e)}}this.eventToSend=[]}getEvent(e,t,r){const i=Qr[e];try{return"function"==typeof i?i(t,ft.createFromContextData(r)):null}catch(n){V.error("Failed to create user event",n)}}startUpdatingStoredEvents(){setInterval((()=>{C(this,f,y).call(this)}),ei)}},ri=new class{isScriptDelayed(e){return Object.keys(ge.delayedScripts).includes(e)}delay(e){if(!this.isScriptDelayed(e))ge.delayedScripts={...ge.delayedScripts,[e]:void 0}}storeDelayedScriptParams(e,t){if(this.isScriptDelayed(e))ge.delayedScripts={...ge.delayedScripts,[e]:t}}initScript(e){var t;const r=ge.delayedScripts[e];if(r){ge.delayedScripts=Object.fromEntries(Object.entries(ge.delayedScripts).filter((([t])=>t!==e)));const i=ue[e];null==(t=null==window?void 0:window[i])?void 0:t.init(...r)}}},ii=new class{setCookie({expiresIn:e,domain:t="",value:r,name:i}){const n=this.getExpirationTimeString(e);document.cookie=`${i}=${r}; expires=${n}; path=/; ${t?`domain=${t}`:""}`}getExpirationTimeString(e){if(e instanceof Date)return e.toUTCString();const t=new Date;return t.setTime(t.getTime()+e),t.toUTCString()}getCookie(e){const t=document.cookie.match(new RegExp(`(^| )${e}=([^;]+)`));if(t)return t[2]}removeUuidCookieSessionInfo(){window.sessionStorage.removeItem(B.UuidHasBeenSet)}},ni=16,si="https://cdnjs.cloudflare.com/ajax/libs/js-sha256/0.11.0/sha256.min.js",oi=new class{async sha256(e){try{const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(r)).map((e=>e.toString(ni).padStart(2,"0"))).join("")}catch(r){V.error("Failed to encrypt visitor e, using fallback lib",r);try{return await(t=si,new Promise(((e,r)=>{const i=Object.assign(document.createElement("script"),{src:t});document.head.append(i),i.addEventListener("load",(()=>{e()}),{once:true}),i.addEventListener("error",(e=>{r(e)}),{once:true})}))),window.sha256(e)}catch(i){return V.error("Failed to encrypt visitor e with fallback lib",i),atob(e)}}var t}},ai=new class{async saveVisitorEmail(e){const t=await oi.sha256(e);ii.setCookie({name:ot.VisitorEmail,value:t,expiresIn:at.OneYear})}async hasVisitorEmailBeenChanged(e){const t=await oi.sha256(e),r=ii.getCookie(ot.VisitorEmail);if(!r)return false;else return t!==r}},ci=4;class ui extends class{setDomain(e){if(!e||"auto"===e)this.cookieDomain=(()=>{const e=new Date,t=location.hostname.split(".").reverse(),r=[],i=`gaDomain-${D(6)}`,n=D(6);let s="";for(e.setTime(e.getTime()+60*1e3),r.push(t.shift());t.length>0;){if(s=r.reverse().join("."),document.cookie=`${i}=${n}; expires=${e.toUTCString()}; domain=.${s}; path=/`,k(i)===n)return s;r.push(t.shift())}return location.hostname})();else this.cookieDomain=e}setListToken(e){this.listToken=e}}{constructor(e,t,r,i){super(),this.cookieDomain="",this.listToken="",this.email="",this.uuid=document.cookie.replace(/(?:(?:^|.*;\s*)gaVisitorUuid\s*\=\s*([^;]*).*$)|^.*$/,"$1")||"",this.valuable=Number(document.cookie.replace(/(?:(?:^|.*;\s*)gaIsValuable\s*\=\s*([^;]*).*$)|^.*$/,"$1")||0),this.gr_x=U("gr_x")||"",this.gr_s=U("gr_s")||"",this.gr_m=U("gr_m")||"",this.gr_co=U("gr_co")||"",this.tracking=new F,this.wasPageVisitEventSaved=false,this.onEventPush=(...[e,t,r,i])=>{ti.push(e,t,r,i)},this.onEventFlush=()=>{ti.flush()},this.onImportScript=async(e,...t)=>{if(Object.values(ce).includes(e)){const{webConnectScriptCdnUrl:r,webConnectCurrentScriptsVersion:i}=ge,n=new URL(`${e}.${i}.umd.js`,r);import(n.href).then((()=>{window[ue[e]].init(...t)}))}else V.error(`Invalid script name ${e}`)},this.onDomainSet=e=>{this.setDomain(e)},this.onListTokenSet=e=>{this.setListToken(e)},this.onSetUserId=async(e,t)=>{if("string"!=typeof e)throw new Error(`User email should be a string`);this.assureDomainIsSet(),this.assureUuidIsSet(),await this.setUserId(e,t)},this.onSetEvent=(e,t)=>{this.assureDomainIsSet(),this.assureUuidIsSet(),this.tracking.setUserId(this.serialize()),this.setEvent(e,t)},this.onSetCookie=(e,t)=>{_(e,t,this.cookieDomain)},this.onPush=()=>{this.push()},this.onSetCustomServiceWorkerPath=e=>{ge.setCustomSwPath(e)},this.createDefaultEventsAndSave=()=>{if("hidden"===document.visibilityState){if(!this.wasPageVisitEventSaved)Kt().saveUserActivity(),this.wasPageVisitEventSaved=true;ge.eventBus.publish(L.FlushEvents)}},this.xsid=r||"",this.tracking.setCustomVariable(1,"grid",t),this.tracking.setCustomVariable(2,"aid",i),this.tracking.setTrackerUrl(`${e}index.php?ver=${ci}`),this.tracking.markAsEnabled(ge.isTrackingEnabled()),this.tracking.setUserId(this.serialize())}async initialize(){if(!this.xsid&&!this.valuable&&ge.isTrackingScriptServedFromCustomDomain())this.xsid=await ve.retrieveXsid();this.attachListeners(),ti.startUpdatingStoredEvents()}attachListeners(){const{eventBus:e}=ge;e.subscribe(L.SetDomain,this.onDomainSet),e.subscribe(L.SetListToken,this.onListTokenSet),e.subscribe(L.SetUserId,this.onSetUserId),e.subscribe(L.SetEvent,this.onSetEvent),e.subscribe(L.SetCookie,this.onSetCookie),e.subscribe(L.Push,this.onPush),e.subscribe(L.SetCustomServiceWorkerPath,this.onSetCustomServiceWorkerPath),e.subscribe(L.ImportScript,this.onImportScript),e.subscribe(L.SetVisitUrlPath,this.onSetVisitUrlPath),e.subscribe(L.SetLastActivityDate,this.onSetLastActivityDate),e.subscribe(L.SetIsNewVisitor,this.onSetIsNewVisitor),e.subscribe(L.SetHasUserVisitPage,this.onSetHasUserVisitPage),e.subscribe(L.SetUserDevice,this.onSetDevice),e.subscribe(L.SetUserLocation,this.onSetUserLocation),e.subscribe(L.SetRawEvent,this.onSetRawEvent),e.subscribe(L.SaveEvent,this.onEventPush),e.subscribe(L.FlushEvents,this.onEventFlush),e.subscribe(L.DelayScript,this.onScriptDelay),e.subscribe(L.InitScript,this.onScriptInit)}assureDomainIsSet(){if(!this.cookieDomain)this.onDomainSet("auto")}assureUuidIsSet(e=false){if(!this.uuid||e){const t=this.generateUuid(e);window.sessionStorage.setItem(B.UuidHasBeenSet,"true"),this.uuid=t}}setValuability(){if(this.gr_x&&(this.gr_s||this.gr_co))this.setIsValuable();if(this.email||this.xsid)this.setIsValuable()}assureEventsAreCreatedAndSaved(){document.addEventListener("visibilitychange",this.createDefaultEventsAndSave)}generateUuid(e=false){let t=k("gaVisitorUuid");if(!t||e)t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),_("gaVisitorUuid",t,this.cookieDomain);return t}async setUserId(e,t){if(e&&ge.isTrackingEnabled()){if(ge.visitorEmail=e,await ai.hasVisitorEmailBeenChanged(e))this.assureUuidIsSet(true);this.email=e,this.listToken=t||this.listToken,this.setIsValuable(),this.push(),await ai.saveVisitorEmail(e)}}setEvent(e,t){if(void 0===t)this.tracking.trackEvent("custom","fire",e);else this.tracking.trackEvent("custom","fire",e,JSON.stringify(t))}push(){this.tracking.setUserId(this.serialize()),this.tracking.trackPageView()}setIsValuable(){if(ge.isTrackingEnabled())this.valuable=1,_("gaIsValuable","1",this.cookieDomain)}serialize(){return JSON.stringify({uuid:this.uuid,email:this.email,xsid:this.xsid,list_token:this.listToken,gr_x:this.gr_x,gr_s:this.gr_s,gr_co:this.gr_co,gr_m:this.gr_m,valuable:this.valuable,domain:this.cookieDomain})}onSetVisitUrlPath(e){const t=q(cr,dr);if(t instanceof lr)t.setVisitPathUrl(e)}onSetLastActivityDate(e){const t=Kt();if(t instanceof Ht)t.setLastActivityDate(e)}onSetIsNewVisitor(e){const t=Kt();if(t instanceof Ht)t.setIsNewVisitor(e)}onSetHasUserVisitPage(e){const t=sr();if(t instanceof ir)t.setHasUserVisitedPage(e)}onSetDevice(e){const t=q(ht,vr);if(t instanceof pr)t.setDeviceType(e)}onSetUserLocation(e){const t=q(mr,Sr);if(t instanceof yr)t.setVisitorCountryCode(e)}onSetRawEvent(e){const t=Zr();if(t instanceof Kr)t.saveEvent(e)}onScriptDelay(e){ri.delay(e)}onScriptInit(e){ri.initScript(e)}}e.init=e=>{const t=JSON.parse(e),{grid:r,clientLatestGrid:i,aid:n,uuuid:s,xsid:o,isServedFromCustomDomain:a,scriptVersion:c,scriptDomain:u,useBackendSubscriberIdentification:l,useBackendStorage:d,trackingUrl:g,tracking:p,isDebugMode:v}=t,h=window["__GetResponseAnalyticsObject"]||"GrTracking";if((()=>{if([Array.from,"".endsWith,"".startsWith,[].entries].some((e=>!e.toString().includes("[native code]"))))V.warn("Modification of native JavaScript object/methods detected, WebConnect might not work correctly!")})(),ge.initialize({xsid:o,aid:n,grid:r,uuuid:s,clientLatestGrid:i,domain:g,useNOStorage:"true"===d,useBetterSubscriberIdentification:"true"===l,isServedFromCustomDomain:"true"===a,scriptsDomain:u,scriptsVersion:c,tracking:"true"===p,isDebugMode:"true"===v}),ge.scriptModuleManager.isScriptInitialized(ce.v2))return;ge.scriptModuleManager.setScriptInitialized(ce.v2);const w=new ui(g,r,o,n);function m(e,t){window[h](e,t)}w.initialize().then((()=>{var e;if(Array.isArray(null==(e=window[h])?void 0:e.q))window[h].q.forEach(((e,t)=>{if("push"!==e[0])ge.eventBus.publish(e[0],e[1],e[2]),delete window[h].q[t]}));window[h]=(e,t,r)=>{ge.eventBus.publish(e,t,r)},w.assureDomainIsSet(),w.assureUuidIsSet(),w.setValuability(),ge.eventBus.publish(L.Push),w.assureEventsAreCreatedAndSaved()})),window.gaSetUserId=e=>{m(L.SetUserId,e)},window.gaPush=()=>{m(L.Push)}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}((e="undefined"!=typeof globalThis?globalThis:e||self).GRV2={})}(this);